/* $RCSFile: ADNDynTask.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/CRMWrapper3/DynEntities/ADNDynTask.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:33  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using CrmSdk;

namespace AddonNice.CRMWrapper
{
	public class ADNDynActivityTask : ADNDynActivity
	{
        protected class Ftor: DFactor
        {
            public Ftor() : base(CrmStr.task)
            {}

            public override Type DynType
            { get { return typeof(ADNDynTransactionCurrency); } }

            public override string DynTypename
            {   get{ return CrmStr.task;}}

            public override DynEntity Build()
            {   return new ADNDynActivityTask();}

            public override DynEntity Build(CRMWrapperBase w, InternalDynamicEntity dEntity, PropertyDescriptorCollection wproperties)
            {   return new ADNDynActivityTask(w, dEntity, wproperties, null);}

            public override DynEntity Build(CRMWrapperBase w, string PrimaryFieldValue)
            {   return new ADNDynActivityTask(w, PrimaryFieldValue);}

            public override DynEntity Build(CRMWrapperBase w,Guid PrimaryKeyValue)
            {   return new ADNDynActivityTask(w,PrimaryKeyValue);}
        }

        static ADNDynActivityTask(){new Ftor();} 

        /// <summary>
		/// Reserved for template methods: do not use directly
		/// </summary>
        public ADNDynActivityTask(): base()
		{}

        public ADNDynActivityTask(CRMWrapperBase w,string subj)
			: base(w, subj,CrmStr.task)
		{}

        public ADNDynActivityTask(CRMWrapperBase w,Guid CrmId)
			: base(w,CrmStr.task, CrmId)
		{}

		public ADNDynActivityTask(CRMWrapperBase w, InternalDynamicEntity e)
			: base(w,CrmStr.task,e,null,null)
		{}

		public ADNDynActivityTask(CRMWrapperBase w, InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s)
			: base(w,CrmStr.task,e,prop,s)
		{}

        public ADNDynActivityTask(ResetWrapperHandler fn,string subj)
			: base(fn, subj,CrmStr.task)
		{}

        public ADNDynActivityTask(ResetWrapperHandler fn,Guid CrmId)
			: base(fn,CrmStr.task, CrmId)
		{}

		public ADNDynActivityTask(ResetWrapperHandler fn, InternalDynamicEntity e)
			: base(fn,CrmStr.task,e,null,null)
		{}

		public ADNDynActivityTask(ResetWrapperHandler fn, InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s)
			: base(fn,CrmStr.task,e,prop,s)
		{}
        
        /// <summary>
        /// Gets or sets the ID for the associated service. 
        /// </summary>
        [CrmDynAttribute(CrmStr.task)]
        public int percentcomplete
        {
            get
            {
                return NumberPropertyValue(CrmStr.percentcomplete);
            }
            set
            {
                AddNumberProperty(CrmStr.percentcomplete,value);
            }
        }

        /// <summary>
        /// Owner for this object
        /// </summary>
        [CrmDynAttribute(CrmStr.task)]
        public override Guid ownerid
        {
            get
            {
                if ( ContainsKey(CrmStr.ownerid) )
                    return OwnerPropertyValue(CrmStr.ownerid);
                return Guid.Empty;
            }
            set
            {
                AddOwnerProperty(CrmStr.ownerid,CrmStr.systemuser,value);
            }
        }
        
    }
}
